//zhi sheng ji

private ["_centerPos", "_rotateDir", "_staticWeaponClasses", "_parkedVehicleClasses", "_index"];
private ["_pos", "_dir", "_posX", "_posY", "_sectionDir", "_guns", "_gun", "_vehicle", "_powerGenerator","_static"];
private ["_fnc_CreateObject", "_parkedArmorClasses", "_armor", "_random", "_objectName", "_hqObject"];
private ["_obj", "_mNumber", "_sarmor", "_objpos", "_guardtower", "_staticAAClasses", "_newpos", "_aaemplacement", "_staticAA"];

if(isNil("A3E_MotorPoolMarkerNumber")) then {
    A3E_MotorPoolMarkerNumber = 0;
} else {
    A3E_MotorPoolMarkerNumber =A3E_MotorPoolMarkerNumber +1;
};

_mNumber = A3E_MotorPoolMarkerNumber;

_centerPos = [_this, 0] call bis_fnc_param;
_rotateDir = [_this, 1] call bis_fnc_param;


_fnc_CreateObject = {
    private ["_className", "_relativePos", "_relativeDir", "_centerPos", "_rotateDir"];
    private ["_object", "_realPos", "_realDir", "_alignWithSurface", "_normal"];
    
    _className = _this select 0;
    _relativePos = _this select 1;
    _relativeDir = _this select 2;
    _centerPos = _this select 3;
    _rotateDir = _this select 4;
    if (count _this > 5) then {
        _alignWithSurface = _this select 5;
    } else {
        _alignWithSurface = false;
    };
    // Object Placement script
    _realPos = ([_centerPos, [(_centerPos select 0) + (_relativePos select 0), (_centerPos select 1) + (_relativePos select 1)], _rotateDir] call a3e_fnc_RotatePosition);
    if (count _relativePos > 2) then {_realPos set [2, (_relativePos select 2)]};	
    _realDir = _relativeDir + _rotateDir;
    _object = createVehicle [_className, _realPos, [], 0, "CAN_COLLIDE"];
    // Object Facing and Vector Up script
    _object setDir _realDir;
    if (_alignWithSurface) then {
        _normal = (surfaceNormal _realPos);
        _object setVectorUp _normal;
    };
    _object
};

_fnc_CreateVehicle = {
    private ["_className", "_relativePos", "_relativeDir", "_centerPos", "_rotateDir"];
    private ["_object", "_realPos", "_realDir"];
    
    _className = _this select 0;
    _relativePos = _this select 1;
    _relativeDir = _this select 2;
    _centerPos = _this select 3;
    _rotateDir = _this select 4;
    
    _realPos = ([_centerPos, [(_centerPos select 0) + (_relativePos select 0), (_centerPos select 1) + (_relativePos select 1)], _rotateDir] call a3e_fnc_RotatePosition);
    _realDir = _relativeDir + _rotateDir;
    _object = createVehicle [_className, _realpos, [], 0, "NONE"];
    _object setDir _realDir;
    _object
};

_pos = [15,-14.8,0];
_dir = 270;
_obj = ["Land_Sign_WarningNoWeapon_F", _pos, _dir, _centerPos, _rotateDir] call _fnc_CreateObject;
_obj allowDamage false; //
_pos = [15,11.2,0];
_dir = 270;
_obj = ["Land_Sign_WarningNoWeapon_F", _pos, _dir, _centerPos, _rotateDir] call _fnc_CreateObject;
_obj allowDamage false; //

//Heli
	_parkedVehicleClasses = ["C_Heli_Light_01_civil_F","B_Heli_Light_01_F"];
    _pos = [-13.751,-17.53,0.00297117];
    _dir = 90;
    _vehicle = selectRandom _parkedVehicleClasses;
    _stupidvehicle = [_vehicle, _pos, _dir, _centerPos, _rotateDir] call _fnc_CreateVehicle;
	Escape_all_assets pushback _stupidvehicle;
	_stupidvehicle setVariable ["Escape_assets_control", true, true];

    _pos = [1.99854,-17.53,0.0029726];
    _dir = 90;
    _vehicle = selectRandom _parkedVehicleClasses;
    _stupidvehicle = [_vehicle, _pos, _dir, _centerPos, _rotateDir] call _fnc_CreateObject;
	Escape_all_assets pushback _stupidvehicle;
	_stupidvehicle setVariable ["Escape_assets_control", true, true];
	
    _pos = [-13.502,-0.779541,0.00295162];
    _dir = 90;
    _vehicle = selectRandom _parkedVehicleClasses;
    _stupidvehicle = [_vehicle, _pos, _dir, _centerPos, _rotateDir] call _fnc_CreateObject;
	Escape_all_assets pushback _stupidvehicle;
	_stupidvehicle setVariable ["Escape_assets_control", true, true];
	
    _pos = [-13.5015,13.97,0.0029645];
    _dir = 90;
    _vehicle = selectRandom _parkedVehicleClasses;
    _stupidvehicle = [_vehicle, _pos, _dir, _centerPos, _rotateDir] call _fnc_CreateObject;
	Escape_all_assets pushback _stupidvehicle;
	_stupidvehicle setVariable ["Escape_assets_control", true, true];
	
    _pos = [1.99902,-1.03003,0.00297308];
    _dir = 90;
    _vehicle = selectRandom _parkedVehicleClasses;
    _stupidvehicle = [_vehicle, _pos, _dir, _centerPos, _rotateDir] call _fnc_CreateObject;
	Escape_all_assets pushback _stupidvehicle;
	_stupidvehicle setVariable ["Escape_assets_control", true, true];
	
    _pos = [1.99902,14.22,0.0029726];
    _dir = 90;
    _vehicle = selectRandom _parkedVehicleClasses;
    _stupidvehicle = [_vehicle, _pos, _dir, _centerPos, _rotateDir] call _fnc_CreateObject;
	Escape_all_assets pushback _stupidvehicle;
	_stupidvehicle setVariable ["Escape_assets_control", true, true];
	
    _pos = [12.5015,-9.55078,0.00392818];
    _dir = 90;
    _vehicle = 'C_Quadbike_01_F';
    _stupidvehicle = [_vehicle, _pos, _dir, _centerPos, _rotateDir] call _fnc_CreateObject;
	Escape_all_assets pushback _stupidvehicle;
	_stupidvehicle setVariable ["Escape_assets_control", true, true];
	
    _pos = [12.5015,-1.05078,0.00395441];
    _dir = 90;
   _vehicle = 'C_Quadbike_01_F';
    _stupidvehicle = [_vehicle, _pos, _dir, _centerPos, _rotateDir] call _fnc_CreateObject;
	Escape_all_assets pushback _stupidvehicle;
	_stupidvehicle setVariable ["Escape_assets_control", true, true];
	
    _pos = [12.5015,6.19922,0.00391293];
    _dir = 90;
    _vehicle = 'C_Quadbike_01_F';
    _stupidvehicle = [_vehicle, _pos, _dir, _centerPos, _rotateDir] call _fnc_CreateObject;
	Escape_all_assets pushback _stupidvehicle;
	_stupidvehicle setVariable ["Escape_assets_control", true, true];

Escape_campType_arr pushback [_centerPos,"载具点","k1"];
publicVariable "Escape_campType_arr";

["A3E_MotorPoolMapMarker" + str _mNumber,_centerPos,"o_service"] call A3E_fnc_createLocationMarker;

_marker = createMarkerLocal ["A3E_MotorPoolPatrolMarker" + str _mNumber, _centerPos];
_marker setMarkerShapeLocal "RECTANGLE";
_marker setMarkerAlphaLocal 0;
_marker setMarkerSizeLocal [40, 38];


